<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
     <title>业主爱家</title>
    <link type="text/css" rel="stylesheet" href="css/common.css">
    <link type="text/css" rel="stylesheet" href="css/login.css">
<script type="text/javascript" src="js/jquery-1.12.4.js">
	
</script>
<script type="text/javascript">

	$(function() {
		
		 $(".logbtn").click(function(){
	         if (!checkUserName() && !checkPassword()){
	        	 
	        	 return false; 
	         }else{
	        	$(".form-horizontal").submit(); 
	         }
	        
	            
	        });
		 
		$("#inputUsername").blur(function() {
			 $(this).next().html("");
			 
		}); 
		$("#inputPassword").blur(function() {
			 $(this).next().html("");	 
		}); 
		function checkUserName(){
			var name =$("#inputUsername").val();
			if(name==null || name==""){
				alert("fjkdjfdlkf");
				 $("#inputUsername").next().html("用户名不为空！");	
				return false;
			}
			return true;
		}
	  function checkPassword(){
		  var pwd =$("#inputPassword").val();
			if(pwd ==null ||  name==""){
				$("#inputPassword").next().html("密码不为空！");	
				return false;
			}
			return true;
		}
	})
	
</script>
</head>
<body>
<div id="background">
    <img src="image/bgLogin2.jpg" width="100%" height="100%"/>
</div>
<div id="login">
    <div id="userImg"><img src="image/user.gif" width="60px" height="60px"/></div>
<form class="form-horizontal" role="form" action="doDevLogin" method="post">
    <div class="title">
        <p style="color:RGB(76, 75, 75);font-weight: bold;">用户登录&nbsp;LOGIN IN</p>
    </div>
    <div class="input" style="background-color: RGB(51, 57, 63);width:300px;height:30px;">
        <label style="color:white;">用户名:</label>
        <input type="text" id="inputUsername" name="userName" style="width:230px;height:20px;" value="">
        <span style="color:red;position:relative;top:6px;">${message}</span>
    </div>
    <br/>
    <div class="input" style="background-color: RGB(51, 57, 63);width:300px;height:30px;">
        <label style="color:white;">密&nbsp; &nbsp;码:</label>
        <input type="password" id="inputPassword" name="password" style="width:230px;height:20px;" value="">
        <span style="color:red;position:relative;top:6px;">${message}</span>
    </div>
    <br/>
    <div class="button"  style="width:190px;height:70px;">
        <button type="button" class="logbtn" >登录</button>
        <a href="regist"><button type="button">注册</button></a>
    </div>
</form>
</div>
</body>
</html>